package com.xbjtech.util;

import java.util.Random;

public class StringUtil {
	
	public static String randomString(int num) {
		StringBuffer sb = new StringBuffer();
		char[] chars = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'};
		Random random = new Random();
		for (int i = 0; i < num; i++) {
			sb.append(chars[random.nextInt(10)]);
		}
		return sb.toString();
	}
	
	public static void main(String[] args) {
		System.out.println(randomString(6));
	}

}
